<HTML><HEAD><TITLE>connected(+Graph)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">library(grasper)</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>connected(+Graph)</H1>
Guarantees that an undirected graph Graph is connected.
<DL>
<DT><EM>Graph</EM></DT>
<DD>A graph.
</DD>
</DL>
<H2>Description</H2>
Guarantees that an undirected graph Graph is connected, i.e., that each vertex is reachable from any other one.
<H3>Fail Conditions</H3>
Fails 
			 if Graph is not an undirected graph variable or
			 if Graph can not be constrained to be connected.
			
<H2>Examples</H2>
<PRE>
?- connected(G).
No.

?- V`::[1,2]..[1,2,3,4], E`::[]..[[1,3],[2,4],[3,1],[4,2]], undirgraph(G,V,E), connected(G).
No.

?- V`::[1,2]..[1,2,3], E`::[]..[[1,2],[1,3],[2,1],[2,3],[3,1],[3,2]], undirgraph(G,V,E), connected(G), graph_labeling(G).
V = [1, 2]
E = [[1, 2], [2, 1]]
G = undirgraph([1, 2], [[1, 2], [2, 1]])
Yes ? ;

V = [1, 2, 3]
E = [[1, 3], [2, 3], [3, 1], [3, 2]]
G = undirgraph([1, 2, 3], [[1, 3], [2, 3], [3, 1], [3, 2]])
Yes ? ;

V = [1, 2, 3]
E = [[1, 2], [2, 1], [2, 3], [3, 2]]
G = undirgraph([1, 2, 3], [[1, 2], [2, 1], [2, 3], [3, 2]])
Yes ? ;

V = [1, 2, 3]
E = [[1, 2], [1, 3], [2, 1], [3, 1]]
G = undirgraph([1, 2, 3], [[1, 2], [1, 3], [2, 1], [3, 1]])
Yes ? ;

V = [1, 2, 3]
E = [[1, 2], [1, 3], [2, 1], [2, 3], [3, 1], [3, 2]]
G = undirgraph([1, 2, 3], [[1, 2], [1, 3], [2, 1], [2, 3], [3, 1], [3, 2]])
Yes
			</PRE>

</BODY></HTML>
